import request from '@/utils/request'

export function queryUser(data) {
  return request({
    url: '/plant/user/queryList',
    method: 'post',
    data
  })
}

export function getUser(id) {
  return request({
    url: `/plant/user/${id}`,
    method: 'get'
  })
}

export function createOrUpdateUser(data) {
  return request({
    url: '/plant/user/createOrUpdateUser',
    method: 'post',
    data
  })
}

export function enable(data) {
  return request({
    url: '/plant/user/enable',
    method: 'post',
    data
  })
}

export function chooseRole(data) {
  return request({
    url: '/plant/user/chooseRole',
    method: 'post',
    data
  })
}

export function roleList(data) {
  return request({
    url: '/plant/role/query',
    method: 'post',
    data
  })
}

export function createOrUpdateRole(data) {
  return request({
    url: '/plant/role/createOrUpdateRole',
    method: 'post',
    data
  })
}

export function roleMenus() {
  return request({
    url: '/plant/role/roleMenus',
    method: 'post'
  })
}

export function getRoleDetails(data) {
  return request({
    url: '/plant/role/getRoleDetails',
    method: 'POST',
    data
  })
}

export function recommend(data) {
  return request({
    url: '/plant/recommend/editShow',
    method: 'POST',
    data
  })
}

export function getrecommend(id) {
  return request({
    url: `/plant/recommend/${id}`,
    method: 'get'
  })
}


export function deleteRole(id) {
  return request({
    url: `/plant/role/${id}`,
    method: 'delete'
  })
}